home *** CD-ROM | disk | FTP | other *** search
/ Programming in Microsoft Windows with C# / Programacion en Microsoft Windows con C#.iso / Codigo / Texto y fuentes / UnderlinedText / UnderlinedText.cs next >
Encoding:
Text File  |  2002-05-03  |  893 b   |  31 lines

  1. //---------------------------------------------
  2. // UnderlinedText.cs ⌐ 2001 by Charles Petzold
  3. //---------------------------------------------
  4. using System;
  5. using System.Drawing;
  6. using System.Drawing.Text;
  7. using System.Windows.Forms;
  8.  
  9. class UnderlinedText: PrintableForm
  10. {
  11.      public new static void Main()
  12.      {
  13.           Application.Run(new UnderlinedText());
  14.      }
  15.      public UnderlinedText()
  16.      {
  17.           Text = "Texto subrayado con HotkeyPrefix";
  18.           Font = new Font("Times New Roman", 14);
  19.      }
  20.      protected override void DoPage(Graphics grfx, Color clr, int cx, int cy)
  21.      {
  22.           string       str    = "íEsto es un texto &s&u&b&r&a&y&a&d&o!";
  23.           StringFormat strfmt = new StringFormat();
  24.  
  25.           strfmt.HotkeyPrefix = HotkeyPrefix.Show;
  26.  
  27.           grfx.DrawString(str, Font, new SolidBrush(clr), 0, 0, strfmt);
  28.      }
  29. }
  30.  
  31.